﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" >
<head>
  <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
  <link rel="stylesheet" href="../css/uftestsuite.css" type="text/css" />
  <script type="text/javascript" src="geo.js"></script>
  <title>Microformats date and time formats</title>
  <script type="text/javascript">
  
  	function checkDates( id) {
  		elt = document.getElementById(id);
  		geo = new RFC2426Geo( elt.value );
  		alert( geo.toString() );
  	}
  	
  	function compareGeo( id1, id2 ) {
  		elt1 = document.getElementById(id1);
  		elt2 = document.getElementById(id2);
  		output = new RFC2426Geo( elt1.value ).toString() + ' - ' + new RFC2426Geo( elt2.value ).toString();
  		alert( 'Are equal: ' + CompareRFC2426Geo( elt1.value, null ) + '\n' + output );
  	}

  </script>
</head>
<body class="documentation">

    <p>
    <a href="http://www.ufxtract.com/testsuite/"><img border="0" id="testsuite-image" alt="Microformats testsuite" src="../images/testsuite.gif" /></a><br />
    </p>
    
    <h1>Microformats geo format</h1>
    
    <h2>Introduction</h2>
    <p>
    Microformats geo is a simple format for marking up locations using the 
	<a href="http://en.wikipedia.org/wiki/WGS84">WGS84</a> geographic coordinates standard. 
	It is suitable for embedding into HTML. geo is a 1:1 representation of the &quot;geo&quot; property (i.e. latitude;longitude) in the 
	vCard standard <a href="http://www.ietf.org/rfc/rfc2426.txt">RFC2426</a>.
	String representations can differ, even for the same numerical value. Trailing zeros and 
the addition of + and - symbols can make string comparison hard. These function canonicalise geo's and allows direct string comparisions.</p>
	
    
   <h2>Canonicalise geo</h2>
   <p>This code takes either of the geo and return it most simple form.</p>
	    
 
	<form>
		<input id="geo1" name="geo1" type="text" style="width: 256px" value="27.13000;-74.89000" />
		<input name="Canonicalise" type="button" value="Canonicalise" onclick="checkDates('geo1')" />
	</form>
	
	
	<h2>Compare</h2>
   	<p>This code takes the two geo's and compares them to see if they are equal.  </p>

	<form>
		<input id="geo2" name="geo2" type="text" style="width: 256px" value="+27.13000;-74.89000" />
		<input id="geo3" name="geo3" type="text" style="width: 256px" value="27.13;-74.89" />
		<input name="compare" type="button" value="compare" onclick="compareGeo('geo2','geo3')" />
	</form>

    	<h2>Examples of geo canonicalisation</h2>

<pre>
+23.70000;+90.30000   23.7;90.3
-23.70000;-90.30000   23.7;-90.3
23.70000;90.30000     23.7;90.3
23.7;90.3             23.7;90.3
</pre>

    
	<p>&nbsp;</p>
    
   
   
	<a rel="license" href="license.txt">Some rights reserved</a>
    
    
</body>
</html>
